<template>
  <el-submenu v-if="nav.children && nav.children.length !== 0" :index="nav.path">
    <template slot="title">
      <i v-if="nav.iconClass" :class="nav.iconClass"></i>
      <span>{{nav.label}}</span>
    </template>
    <sub-menu v-for="navItem in nav.children" :key="navItem.path"
              :nav="navItem"></sub-menu>
  </el-submenu>
  <el-menu-item v-else :index="nav.path">{{nav.label}}</el-menu-item>
</template>

<script>
/**
 * @Author: lifuzhao
 * @Date: 2019-08-20
 * @Project: shop_cms
 */
export default {
  name: 'subMenu',
  props: ['nav'],
  mounted() {
    console.log(this.nav);
  },
};
</script>

<style scoped>

</style>
